package dyyx;

import java.io.StringWriter;

import freemarker.template.Configuration;
import freemarker.template.Template;

public class FreemarkerDemo {

	public static void main(String[] args) throws Exception {		
		Configuration cfg = new Configuration();
		cfg.setClassForTemplateLoading(FreemarkerDemo.class, "/");
		Template template = cfg.getTemplate("/template/hello.ftl");
		System.out.println("template="+template);
		StringWriter writer = new StringWriter();
		template.process(Data.data(), writer);
		System.out.println(writer);

	}
}
